﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using myBoard.App.Model;

namespace myBoard.App.Components.MagnetsStore.Commands
{
    public class CreateNewMagnetCommand : ICommand
    {
        #region ICommand Members

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            Instances instances = new Instances();
            instances.MagnetsViewModel.ConnectedUserSubmittedMagnets.Add(
                new myBoard.App.Components.MagnetsStore.ViewsModels.MagnetViewModel(new myBoard.App.MagnetStore.Magnet()
                    {
                         Name="New magnet",
                         Author=instances.UsersViewModel.ConnectedUser
                    }));
        }

        #endregion
    }
}
